package com.qf.efserver.sport.controller;

import com.qf.common.core.common.R;
import com.qf.efserver.sport.param.WaterParam;
import com.qf.efserver.sport.service.WaterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/water")
@Api(tags = "喝水相关接口")
public class WaterController {
    private final WaterService waterService;
    @GetMapping("/selectWater")
    @ApiOperation(value = "查询今日喝水量")
    public R<WaterParam> selectWater(){
        WaterParam waterParam = waterService.selectWater();

        return R.ok(waterParam);
    }
    @GetMapping("/addWater")
    @ApiOperation(value = "添加喝水量")
    @ApiImplicitParam(name = "waterNum",value = "喝水量")
    public R addWater(Integer waterNum){
        waterService.addWater(waterNum);
        return R.ok();
    }


}
